<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 原生 onchange ，在失去焦点后才会触发事件处理函数内部代码 -->
    <input id="ipt" type="text" />
    <script>
      const ipt = document.querySelector('#ipt')

      ipt.oninput = (e) => {
        console.log(e.target.value)
      }
    </script>
  </body>
</html>
